<template>

	<body>
		<div class="loan_nav">
			<ul>
				<li>
					<a href="javascript:history.go(-1)">
						<i class="iconfont">&#xe61e;</i>
					</a>
				</li>
				<li>
					<p>意见反馈</p>
				</li>
				<li></li>
			</ul>
		</div>
		<div class="interval_T">

		</div>
		<div>
			<swiper :list="imgList" :show-dots="false" loop auto :aspect-ratio="0.3" dots-position="center" dots-class="custom-bottom"></swiper>
		</div>
		<div class="theme">
			<ul>
				
				<li><input v-model="params.title" type="text" maxlength="30" placeholder="请输入标题（不超过30个字）" /></li>
			</ul>
		</div>
		<div class="add_content">
			<textarea v-model="params.content" placeholder="请输入添加的内容" maxlength="60" rows="8"></textarea>
		</div>
		<!-- <x-button  type="primary">提交</x-button> -->
		<div class="btn">
			<input @click="save" type="button" value="提交" class="col_dr2" />
		</div>
	</body>
</template>

<script>
import { XButton } from 'vux'
export default {
	components: {
		XButton
	},
	data() {
		return {
			params: {
				types: 2
			},

			imgList: []
		}
	},
	created() {
		this.queryImg()
	},
	methods: {
		save() {
			this.$http.post('/app/feedback/save', this.params).then(json => {
				const { code } = json
				if (code === 0) {
					this.$vux.toast.show({ text: '提交成功' })
					this.$router.back()
				}
			})
		},

		queryImg() {
			this.$http.get('/app/index/carousel', {
				params: { page: 'feedbackfeedback' }
			}).then(json => {
				const { code, carousel } = json
				if (code === 0) {
					carousel.forEach(n => {
						this.imgList.push({
							url: n.url,
							img: n.imgPath
						})
					})
				}
			})
		}
	}
}
</script>

<style>

</style>